package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SAnnounMapper;
import com.ruoyi.system.domain.SAnnoun;
import com.ruoyi.system.service.ISAnnounService;

/**
 * 通知公告Service业务层处理
 * 
 * @author yu
 * @date 2024-05-08
 */
@Service
public class SAnnounServiceImpl implements ISAnnounService 
{
    @Autowired
    private SAnnounMapper sAnnounMapper;

    /**
     * 查询通知公告
     * 
     * @param noticeId 通知公告主键
     * @return 通知公告
     */
    @Override
    public SAnnoun selectSAnnounByNoticeId(Integer noticeId)
    {
        return sAnnounMapper.selectSAnnounByNoticeId(noticeId);
    }

    /**
     * 查询通知公告列表
     * 
     * @param sAnnoun 通知公告
     * @return 通知公告
     */
    @Override
    public List<SAnnoun> selectSAnnounList(SAnnoun sAnnoun)
    {
        return sAnnounMapper.selectSAnnounList(sAnnoun);
    }

    /**
     * 新增通知公告
     * 
     * @param sAnnoun 通知公告
     * @return 结果
     */
    @Override
    public int insertSAnnoun(SAnnoun sAnnoun)
    {
        sAnnoun.setCreateTime(DateUtils.getNowDate());
        return sAnnounMapper.insertSAnnoun(sAnnoun);
    }

    /**
     * 修改通知公告
     * 
     * @param sAnnoun 通知公告
     * @return 结果
     */
    @Override
    public int updateSAnnoun(SAnnoun sAnnoun)
    {
        return sAnnounMapper.updateSAnnoun(sAnnoun);
    }

    /**
     * 批量删除通知公告
     * 
     * @param noticeIds 需要删除的通知公告主键
     * @return 结果
     */
    @Override
    public int deleteSAnnounByNoticeIds(Integer[] noticeIds)
    {
        return sAnnounMapper.deleteSAnnounByNoticeIds(noticeIds);
    }

    /**
     * 删除通知公告信息
     * 
     * @param noticeId 通知公告主键
     * @return 结果
     */
    @Override
    public int deleteSAnnounByNoticeId(Integer noticeId)
    {
        return sAnnounMapper.deleteSAnnounByNoticeId(noticeId);
    }
}
